<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />

    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Line chart with the X axis in the middle</title>
    
    <meta name="description" content="A Line chart that shows the center position for the X axis" />
</head>
<body>

    <h1>A Line chart demonstrating  the axis options</h1>

    <button onclick="obj = getObject(); obj.Set('chart.xaxispos', obj.Get('chart.xaxispos') == 'bottom' ? 'center' : 'bottom'); RGraph.Redraw();">Toggle the X axis position</button>
    <button onclick="obj = getObject(); obj.Set('chart.yaxispos', obj.Get('chart.yaxispos') == 'left' ? 'right' : 'left'); RGraph.Redraw();">Toggle the Y axis position</button>
    <button onclick="obj = getObject(); obj.Set('chart.ylabels', obj.Get('chart.ylabels') ? false : true); RGraph.Redraw();">Toggle the Y axis labels</button>
    <button onclick="obj = getObject(); obj.Set('chart.ylabels.specific', obj.Get('chart.ylabels.specific') ? null : ['High','Medium','Low']); RGraph.Redraw();">Toggle specific Y axis labels</button>
    <button onclick="obj = getObject(); obj.Set('chart.ymin', obj.Get('chart.ymin') ? 0 : 50); RGraph.Redraw();">Toggle ymin (50) setting</button>
    <button onclick="obj = getObject(); obj.Set('chart.noxaxis', obj.Get('chart.noxaxis') ? false : true); RGraph.Redraw();">Toggle X axis </button>
    <button onclick="obj = getObject(); obj.Set('chart.labels', obj.Get('chart.labels') ? null : ['Q1','Q2','Q3','Q4']); RGraph.Redraw();">Toggle X labels</button>
    
    <br />

    <canvas id="cvs" width="600" height="400">[No canvas support]</canvas>
    
    <script>
        function getObject ()
        {
            return RGraph.ObjectRegistry.getFirstObjectByType('line');
        }

        window.onload = function ()
        {
            var line = new RGraph.Line('cvs', [65,70,74,64,58,94,75,64,68,78])
                .Set('ymax', 100)
                .Set('xmax', 365)
                .Set('labels', ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'])
                .Set('xaxispos', 'center')
                .Set('gutter.bottom', 45)
                .Draw();
        }
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>